<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
    xmlns:pm="http://primefaces.org/mobile"
    xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    template="template/template3.xhtml">
    
    <ui:define name="content">
        <pm:content styleClass="jqm-content">
            <h:form id="detailForm">
            <c:forEach var="item" items="#{stageController.dynaformfields}">            	
            	<pm:field>
	                <p:outputLabel value="#{item.field.label}" />
	                <c:choose>
	               	 	<c:when test="#{item.idType == 101}">
                			<p:selectBooleanCheckbox id="selectBooleanCheckbox" itemLabel=" " value="#{item.formValue}"/>          
					    </c:when>
					    <c:when test="#{item.idType == 105}">
					       <p:inputText value="#{item.formValue}" required="#{item.field.required}"/>
					    </c:when>
					    <c:when test="#{item.idType == 102}">					     
					        <p:selectOneMenu value="#{item.formValue}">
			                    <f:selectItem itemLabel="Seleccione" itemValue="" />  
		                		<f:selectItems value="#{item.field.fieldOptionList}" var ="subitem" 
		                			itemValue="#{subitem.idOption}" itemLabel="#{subitem.value}"  /> 
			                </p:selectOneMenu>
					    </c:when>
					    <c:when test="#{item.idType == 106}">
					         <p:inputTextarea value="#{item.formValue}"/>
					    </c:when>
					  	<c:when test="#{item.idType == 103}">
					  	<p:calendar pattern="MM/dd/yyyy" value="#{item.formValue}"/>
					  	</c:when>
					  	<c:when test="#{item.idType == 104}">
					  	 <p:selectOneRadio id="selectOneRadio" value="#{item.formValue}">
                   				<f:selectItems value="#{item.field.fieldOptionList}" var ="subitem" 
		                			itemValue="#{subitem.idOption}" itemLabel="#{subitem.value}"  />
               			 </p:selectOneRadio>
					  	</c:when>
					  	<c:when test="#{item.idType == 111}">
					  		<p:outputLabel value="#{item.formValue}"/>
					  	</c:when>
					</c:choose>
            	</pm:field>
			</c:forEach>
           
            <p:commandButton styleClass="ui-btn-b"  value="Aceptar" type="submit" action="#{stageController.saveTarea}"/>
            <p:commandButton styleClass="ui-btn-b"  value="Actualizar" type="submit" action="#{stageController.updateTarea}"/>
          	<p:commandButton styleClass="ui-btn-b"  value="Rechazar" type="submit" action="#{stageController.irProcesos}" immediate="true"/>                
            
            </h:form>
        </pm:content>
    </ui:define>
    
</ui:composition>